﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Configure.aspx.cs" Inherits="InstanceConfigurer.Configure" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
	<style type="text/css">
		.style1
		{
			width: 70%;
		}
		.style2
		{
			width: 200px;
			text-align: right;
		}
		.style3
		{
			vertical-align:middle;
		}
	</style>
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <h2>
        Instance Monitor Configuration Settings
    </h2>
    <p>
        Enter/View Settings.
    </p>
    <table class="style1">
		<tr>
			<td colspan="2">
				<asp:Label ID="LabelPartitionKey" runat="server" Text="PartitionKey" Font-Size="Small"></asp:Label>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<asp:Label ID="LabelRowKey" runat="server" Text="RowKey" Font-Size="Small"></asp:Label>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label16" runat="server" Text="Operating Mode" Font-Size="Small"></asp:Label>
			</td>
			<td>
				<asp:Label ID="LabelMode" runat="server" Text="Auto" Font-Size="Small"></asp:Label>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label1" runat="server" Text="SubScription ID"></asp:Label>
			</td>
			<td>
				<asp:TextBox ID="TextBoxSubscriptionID" runat="server" Width="400px"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label2" runat="server" Text="Certificate Thumb Print"></asp:Label>
			</td>
			<td>
				<asp:TextBox ID="TextBoxCertificateThumbPrint" runat="server" Width="400px"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label4" runat="server" Text="Storage Service Name"></asp:Label>
			</td>
			<td>
				<asp:TextBox ID="TextBoxStorageServiceName" runat="server" Width="400px"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label5" runat="server" Text="Slot"></asp:Label>
			</td>
			<td>
				<asp:RadioButton ID="RadioButton1" runat="server" Checked="True" 
					GroupName="Slot" Text="Staging" />
				<asp:RadioButton ID="RadioButton2" runat="server" GroupName="Slot" 
					Text="Production" />
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label6" runat="server" Text="Deployment ID"></asp:Label>
			</td>
			<td>
				<asp:TextBox ID="TextBoxDeploymentID" runat="server" Width="400px"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label7" runat="server" Text="Role Name"></asp:Label>
			</td>
			<td>
				<asp:TextBox ID="TextBoxRoleName" runat="server" Width="400px" Enabled="False"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label10" runat="server" Text="Instances Counts"></asp:Label>
			</td>
			<td class="style3">
				&nbsp;&nbsp;<asp:Label ID="Label12" runat="server" Text=" Maximum "></asp:Label>
				<asp:TextBox ID="TextBoxMaxInstances" runat="server" Width="50px"></asp:TextBox>
			&nbsp;&nbsp;<asp:Label ID="Label13" runat="server" Text=" Minimum "></asp:Label>
				<asp:TextBox ID="TextBoxMinInstances" runat="server" Width="50px"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label11" runat="server" Text="Instance Stepping"></asp:Label>
			</td>
			<td class="style3">
				&nbsp;&nbsp;<asp:Label ID="Label14" runat="server" Text=" Increment Step "></asp:Label>
				<asp:TextBox ID="TextBoxStepUp" runat="server" Width="50px" Text="1"></asp:TextBox>
			&nbsp;&nbsp;<asp:Label ID="Label15" runat="server" Text=" Decrement Step "></asp:Label>
				<asp:TextBox ID="TextBoxStepDown" runat="server" Width="50px" Text="1"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label17" runat="server" Text="Processor Usage Range"></asp:Label>
			</td>
			<td class="style3">
				<asp:CheckBox ID="CheckBoxUseDefaults" runat="server" Checked="True" 
					Text="Use Defaults" />
				&nbsp;&nbsp; or set:&nbsp; <asp:Label ID="Label18" runat="server" Text=" Top % "></asp:Label>
				<asp:TextBox ID="TextBoxTopTheshold" runat="server" Width="50px" Text="70"></asp:TextBox>
			&nbsp;&nbsp;<asp:Label ID="Label19" runat="server" Text=" Bottom % "></asp:Label>
				<asp:TextBox ID="TextBoxBottomThreshold" runat="server" Width="50px" Text="50"></asp:TextBox>
			</td>
		</tr>
		<tr>
			<td class="style2">
				&nbsp;</td>
			<td>
				<asp:Button ID="ButtonSave" runat="server" onclick="ButtonSave_Click" 
					Text="Save" />
&nbsp;
				<asp:Button ID="ButtonView" runat="server" onclick="ButtonView_Click" 
					Text="View" />
			&nbsp;
				<asp:Button ID="ButtonDelete" runat="server" onclick="ButtonDelete_Click" 
					Text="Delete Configuration" 
					ToolTip="Deletes the diagnostic cofiguration from table storage." />
			</td>
		</tr>
		<tr>
			<td colspan="2"><br /><br /></td>
		</tr>
		<tr>
			<td class="style2">
			</td>
			<td>
				<asp:Label ID="Label9" runat="server" Text="Performance Counters"></asp:Label>
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label8" runat="server" Text="Commands"></asp:Label>
			</td>
			<td>
				<asp:Button ID="ButtonInitialize" runat="server" 
					onclick="ButtonInitialize_Click" Text="Initialize" />
&nbsp;
				<asp:Button ID="ButtonRemove" runat="server" onclick="ButtonRemove_Click" 
					Text="Clear Counters" ToolTip="Erases all counter data from table storage." />
			</td>
		</tr>
		<tr>
			<td class="style2">
				<asp:Label ID="Label20" runat="server" Text="Log Storage"></asp:Label>
			</td>
			<td>
				<asp:Button ID="ButtonClearLogs" runat="server" 
					Text="Clear Logs" ToolTip="Erases all log data from table storage." 
					onclick="ButtonClearLogs_Click" />
			</td>
		</tr>
		<tr>
			<td>			&nbsp;
			</td>
			<td>
			</td>
		</tr>
		<tr>
			<td colspan="2">
				<asp:Label ID="LabelError" runat="server" Text="" Font-Size="Small" ForeColor="#990000"></asp:Label>
			</td>
		</tr>
	</table>
    <p>
       
    	Discussion:<br />
		Enter the required data from your Azure Portal settings. The Certificate Thumb 
		Print is found in the Management Certificates section.&nbsp; The Hosted Service 
		Name is found in the Hosted Services section under the &quot;DNS Prefix&quot;.&nbsp; It is 
		NOT the &quot;Name&quot;, yes it is confusing.</p>
	<p>
       
    	&nbsp;</p>
</asp:Content>
